// @ts-ignore
import { api } from '@/utils/api';

/** 新增字典主信息数据接口 POST /dicMain/add */
export async function dicMainAdd(
  body: BASE.DicMain,
  options?: ArgumentsType<typeof api>[1]
): Promise<BASE.IResult>;

export async function dicMainAdd(
  body: BASE.DicMain,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BASE.IResult>>;

export async function dicMainAdd(
  body: BASE.DicMain,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BASE.IResult>;

export async function dicMainAdd(body: BASE.DicMain, options?: ArgumentsType<typeof api>[1]) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BASE.IResult>(`/app/dicMain/add`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      data: body,
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BASE.IResult>(`/app/dicMain/add`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  });
}

/** 复制字典主信息数据接口 POST /dicMain/copy */
export async function dicMainCopy(
  body: BASE.DicCopyDTO,
  options?: ArgumentsType<typeof api>[1]
): Promise<BASE.IResult>;

export async function dicMainCopy(
  body: BASE.DicCopyDTO,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BASE.IResult>>;

export async function dicMainCopy(
  body: BASE.DicCopyDTO,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BASE.IResult>;

export async function dicMainCopy(body: BASE.DicCopyDTO, options?: ArgumentsType<typeof api>[1]) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BASE.IResult>(`/app/dicMain/copy`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      data: body,
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BASE.IResult>(`/app/dicMain/copy`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  });
}

/** 删除字典主信息数据接口 POST /dicMain/delete */
export async function dicMainDelete(
  body: BASE.ID,
  options?: ArgumentsType<typeof api>[1]
): Promise<BASE.IResult>;

export async function dicMainDelete(
  body: BASE.ID,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BASE.IResult>>;

export async function dicMainDelete(
  body: BASE.ID,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BASE.IResult>;

export async function dicMainDelete(body: BASE.ID, options?: ArgumentsType<typeof api>[1]) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BASE.IResult>(`/app/dicMain/delete`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      data: body,
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BASE.IResult>(`/app/dicMain/delete`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  });
}

/** 获取字典主信息数据接口 POST /dicMain/get */
export async function dicMainGet(
  body: BASE.ID,
  options?: ArgumentsType<typeof api>[1]
): Promise<BASE.IResultDicMain>;

export async function dicMainGet(
  body: BASE.ID,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BASE.IResultDicMain>>;

export async function dicMainGet(
  body: BASE.ID,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BASE.IResultDicMain>;

export async function dicMainGet(body: BASE.ID, options?: ArgumentsType<typeof api>[1]) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BASE.IResultDicMain>(`/app/dicMain/get`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      data: body,
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BASE.IResultDicMain>(`/app/dicMain/get`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  });
}

/** 根据code获取详情 POST /dicMain/getDicCode */
export async function dicMainGetDicCode(
  body: BASE.CodeDTO,
  options?: ArgumentsType<typeof api>[1]
): Promise<BASE.IResultDicMain>;

export async function dicMainGetDicCode(
  body: BASE.CodeDTO,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BASE.IResultDicMain>>;

export async function dicMainGetDicCode(
  body: BASE.CodeDTO,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BASE.IResultDicMain>;

export async function dicMainGetDicCode(
  body: BASE.CodeDTO,
  options?: ArgumentsType<typeof api>[1]
) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BASE.IResultDicMain>(`/app/dicMain/getDicCode`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      data: body,
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BASE.IResultDicMain>(`/app/dicMain/getDicCode`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  });
}

/** 字典主信息分页数据接口 POST /dicMain/page */
export async function dicMainPage(
  body: BASE.DicMainQuery,
  options?: ArgumentsType<typeof api>[1]
): Promise<BASE.IResultIPageDicMain>;

export async function dicMainPage(
  body: BASE.DicMainQuery,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BASE.IResultIPageDicMain>>;

export async function dicMainPage(
  body: BASE.DicMainQuery,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BASE.IResultIPageDicMain>;

export async function dicMainPage(body: BASE.DicMainQuery, options?: ArgumentsType<typeof api>[1]) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BASE.IResultIPageDicMain>(`/app/dicMain/page`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      data: body,
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BASE.IResultIPageDicMain>(`/app/dicMain/page`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  });
}

/** 更新字典主信息数据接口 POST /dicMain/update */
export async function dicMainUpdate(
  body: BASE.DicMain,
  options?: ArgumentsType<typeof api>[1]
): Promise<BASE.IResult>;

export async function dicMainUpdate(
  body: BASE.DicMain,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BASE.IResult>>;

export async function dicMainUpdate(
  body: BASE.DicMain,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BASE.IResult>;

export async function dicMainUpdate(body: BASE.DicMain, options?: ArgumentsType<typeof api>[1]) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BASE.IResult>(`/app/dicMain/update`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      data: body,
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BASE.IResult>(`/app/dicMain/update`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  });
}
